﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UserCenterPage.Master" AutoEventWireup="true"
    CodeBehind="UserCourseCalendar.aspx.cs" Inherits="VideoNetApplication.UserCenter.UserCourseCalendar" %>

<asp:Content ContentPlaceHolderID="Child" runat="server" ID="content">

    <script type="text/javascript">
        
        $(document).ready(function() {
        $("#classInfo").hide();
            
           
        });
        function VideoPalyByIndex(index) {

            $("[DataField='CurrentIndex']").val(index);
            VideoNetSchool.Calendar.LoadClass(index, $("[DataField='CourselistID']").val(), $("[DataField='CourseDate']").val(), $("[DataField='RoomId']").val(), $("[DataField='StartTime']").val(), $("[DataField='EndTime']").val());
        }

        function VideoPlay(listId, date, roomId, startTime, endTime) {
            $("[DataField='CourselistID']").val(listId);
            $("[DataField='CourseDate']").val(date);
            $("[DataField='RoomId']").val(roomId);
            $("[DataField='StartTime']").val(startTime);
            $("[DataField='EndTime']").val(endTime);
            
            
            
            
            
            
            VideoNetSchool.Calendar.LoadClass(0, listId, date, roomId, startTime, endTime);

        }

        function SwitchTab(liIndex, showId) {
            $("#rdMonth").hide();
            $("#rdWeek").hide();
            $("#rdClass").hide();
            $("#" + showId).show();
            $("#tabUl").find("li").each(function() { $(this).removeClass(); });
            var li = $("#tabUl").find("li:eq(" + liIndex + ")"); //.addClass("LiHover");
            li.addClass("on");

        }
        function caculate_length(check_area)   //检测剩余可输入字符数   by   space   2006-4-11   13:14   
        {
            var ShortCommodityName = $("#txtComment").val();
            var Ennum = 0;
            var Chnum = 0;
            newarry = ShortCommodityName.split("");
            for (i = 0; i < newarry.length; i++) {
                if (ischinese(newarry[i])) {
                    Chnum = parseInt(Chnum) + 2;
                }
                else {
                    Ennum = parseInt(Ennum) + 1;
                }
            }
            var text_length = Chnum + Ennum;
            var text_max_length = 140;
            var target_div = document.getElementById("fontNum");
            var text_remain = text_max_length - text_length;
            if (text_remain <= 0) {
                var charsum = Chnum / 2 + Ennum - 1;
                var text_remainstr = $("#txtComment").val().substring(charsum, 140);
                $("#txtComment").val($("#txtComment").val().replace(text_remainstr, ''));
                text_remain = 0;
            }
            target_div.innerHTML = "<font   color=#ff0000>" + text_remain + "</font>";
        }

        function ischinese(strword) {
            var newPar = /[^\u4E00-\u9FA5]/g
            return !newPar.test(strword);
        }


        function LoadPlayer(filePath, imgPath) {
            var flashvars = {
                file: filePath,
                type: 'http',
                image: imgPath,
                autostart: 'true',
                streamer: 'start'
            };
            var params = {
                allowfullscreen: 'true',
                allowscriptaccess: 'always'
            };
            var attributes = {
                id: 'player',
                name: 'player'
            };
            swfobject.embedSWF('../plugin/flvplayer.swf', 'container', '645', '455', '9.0.115', false, flashvars, params, attributes);
        }
        $(function() {
            var height = 0;
            for (i = 0; i < $('.course_up').length; i++) {
                if ($('.course_up').eq(i).height() > height) {
                    height = $('.course_up').eq(i).height();
                }
            }
            $(".course_up").height(height);
            $("#rdWeek").hide();
        });
        function resetHeight() {
            var height = 0;
            for (i = 0; i < $('.course_up').length; i++) {
                if ($('.course_up').eq(i).height() > height) {
                    height = $('.course_up').eq(i).height();
                }
            }
             
            $(".course_up").height(height);
        }
    </script>

    <div class="crumb">
        <div class="crumb_main">
            您的当前位置：<a href="<%= ResolveClientUrl("~/")%>">首页</a> &gt; <a href="<%= ResolveClientUrl("~/UserCenter/UserCourseCalendar.aspx")%>">
                复习频道</a> <asp:Literal ID="ltrClassInfo" runat="server"></asp:Literal>
        </div>
    </div>
    <div class="main mb15">
        <div class="pleft">
            <div class="video" id="v">
                <div id="container">
                </div>
                <span id="spanPlayer">
                    <embed src="../images/loading.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="645" height="445"></embed>
                    </span>
                </div>
                <input type="hidden" id="hfPlay" />
            <span id="Player"></span>
            <div class="kb">
                <div class="item">
                    <h3>
                        <ul id="tabUl">
                            <li class="on"><a href="javascript:SwitchTab(0,'rdMonth')">按月</a></li>
                            <li><a href="javascript:SwitchTab(1,'rdWeek')">按周</a></li>
                            <li><a href="javascript:SwitchTab(2,'rdClass')">按课程</a></li>
                        </ul>
                    </h3>
                    <div class="kb_c" id="rdMonth" >
                        <div class="main_calendar layout">
                            <div style="display: inline; float: left; margin-left: 5px">
                                <div class="date_new">
                                    公元
                                    <asp:DropDownList ID="caleyear" runat="server" class="year" AutoPostBack="true" OnSelectedIndexChanged="Calendar_SelectedIndexChanged">
                                        <asp:ListItem Value="2010">2010</asp:ListItem>
                                        <asp:ListItem Value="2011">2011</asp:ListItem>
                                        <asp:ListItem Value="2012">2012</asp:ListItem>
                                        <asp:ListItem Value="2013">2013</asp:ListItem>
                                        <asp:ListItem Value="2014">2014</asp:ListItem>
                                        <asp:ListItem Value="2015">2015</asp:ListItem>
                                        <asp:ListItem Value="2016">2016</asp:ListItem>
                                        <asp:ListItem Value="2017">2017</asp:ListItem>
                                        <asp:ListItem Value="2018">2018</asp:ListItem>
                                        <asp:ListItem Value="2019">2019</asp:ListItem>
                                        <asp:ListItem Value="2020">2020</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="calemon" runat="server" AutoPostBack="true" class="riqi" OnSelectedIndexChanged="Calendar_SelectedIndexChanged">
                                        <asp:ListItem Value="1">1</asp:ListItem>
                                        <asp:ListItem Value="2">2</asp:ListItem>
                                        <asp:ListItem Value="3">3</asp:ListItem>
                                        <asp:ListItem Value="4">4</asp:ListItem>
                                        <asp:ListItem Value="5">5</asp:ListItem>
                                        <asp:ListItem Value="6">6</asp:ListItem>
                                        <asp:ListItem Value="7">7</asp:ListItem>
                                        <asp:ListItem Value="8">8</asp:ListItem>
                                        <asp:ListItem Value="9">9</asp:ListItem>
                                        <asp:ListItem Value="10">10</asp:ListItem>
                                        <asp:ListItem Value="11">11</asp:ListItem>
                                        <asp:ListItem Value="12">12</asp:ListItem>
                                    </asp:DropDownList>
                                    月
                                </div>
                            </div>
                            <div id="tableCourseList" runat="server" style="display: inline; float: left; margin-left: 5px">
                            </div>
                        </div>
                    </div>
                    <div class="kb_c" id="rdWeek" >
                        <table border="0" id="table01" class="table01"  cellpadding="0" cellspacing="0">
                            <tr><td  class="pic"><a href="javascript:" onclick="resetHeight();VideoNetSchool.Calendar.PreWeek();" title="上一周"><img src="../Images/left.png" alt="上一周" /></a>  <a href="javascript:" onclick="resetHeight();VideoNetSchool.Calendar.NextWeek();" title="下一周"><img src="../Images/right.png" alt="下一周" /></a></td></tr>
                            <tr>
                                <td>
                                    <table id="table02" class="table02" width="100%" border="0" cellpadding="0" cellspacing="0">
                                        <span id="spCourseList">
                                        <asp:Literal ID="CourseList" runat="server"></asp:Literal>
                                        </span>
                                         
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="kb_c" id="rdClass" style="display: none">
                        <div class="kuandu">
                            <div class="smallbox">
                                <div class="classform">
                                    <table border="0" cellpadding="0" cellspacing="1">
                                        <tr>
                                            <td class="formyangshi1" style="background-color: #dddddd;">
                                                课程
                                            </td>
                                            <td class="formyangshi2" style="background-color: #dddddd;">
                                                课时
                                            </td>
                                            <td class="formyangshi3" style="background-color: #dddddd;">
                                                课程详细
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <span id="courseTable" runat="server"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="pright">
            <div class="mb15 login">
                <VideoNet:UControl ID="control" runat="server"></VideoNet:UControl>
            </div>
            <div class="mb15 kc_info">
                <div class="item ">
                    <h3>
                        <sub class="icon icon_expand" id="clsInfo" onclick="VideoNetSchool.ControlCenter.HidControl('clsInfo','classInfo');">
                        </sub><strong>课程信息</strong></h3>
                    <div class="kc_info_c" id="classInfo">
                        <p>
                            课程名称：<span id="CourseName">请选择课程</span></p>
                        <p>
                            主讲师：<span id="TeacherName">暂无</span></p>
                        <p>
                            视频介绍：<span id="CourseDesc">暂无</span></p>
                    </div>
                </div>
            </div>
            <div class="mb15 comments">
                <div class="item ">
                    <h3>
                        <sub class="icon icon_expand" id="coment" onclick="VideoNetSchool.ControlCenter.HidControl('coment','coments');">
                        </sub><strong>课程评论</strong></h3>
                    <div class="comments_c" id="coments">
                        <div class="comments_sb">
                            <div class="comments_text">
                                <textarea id="txtComment" onkeyup="caculate_length()" onclick="if(this.value=='请先选择课程再评论!'){this.select();}">请先选择课程再评论!</textarea>
                            </div>
                            <div class="comments_bt">
                                <span class="fl">你还剩余<span id='fontNum'>140</span>字可输入</span><span class="fr"><input
                                    type="button" class="bt2" value="发布评论" onclick="VideoNetSchool.Comment.PostComment();" /></span></div>
                        </div>
                        <div class="comments_list" id="commentList">
                        <span id="spComment"></span>
                         <%-- <VideoNet:Comment ID="Comment" runat="server" />--%>
                         <div id="pager"  class="pages"></div>
                         <input type="hidden" DataField="PageCount"  id="hfPageCount"/>
                         <input type="hidden" DataField="PageSize" id="hfPageSize" value='6' />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class=" clear">
        </div>
    </div>
    <input type="hidden" id="CurrentMinY"  runat="server" datafield='CurrentMinY'/>
    <input type="hidden" id="CurrentMinMon"  runat="server" datafield='CurrentMinMon'/>
    <input type="hidden" id="CurrentMinDay"  runat="server" datafield='CurrentMinDay'/>
    <input type="hidden" id="CurrentMaxY"  runat="server" datafield='CurrentMaxY'/>
    <input type="hidden" id="CurrentMaxMon"  runat="server" datafield='CurrentMaxMon'/>
    <input type="hidden" id="CurrentMaxDay"  runat="server" datafield='CurrentMaxDay'/>
    <input type="hidden" id="hidCurrentIndex" runat="server" datafield='CurrentIndex' />
    <input type="hidden" id="HidCourselistID" runat="server" datafield='CourselistID' />
    <input type="hidden" id="HidRoomId" runat="server" datafield='RoomId' />
    <input type="hidden" id="HidCourseDate" runat="server" datafield='CourseDate' />
    <input type="hidden" id="HidStartTime" runat="server" datafield='StartTime' />
    <input type="hidden" id="HidEndTime" runat="server" datafield='EndTime' />
        <input type="hidden" id="HidSchoolId" runat="server" datafield='SchoolId' />
</asp:Content>
